import json

import requests

from contant.gaode import *


class GaodeDiLiService:
    @classmethod
    def get_address(cls, location: str):

        post_data = {
            'key': GAODE_KEY,
            'location': location
        }
        # 发送HTTP请求
        response = requests.get(GAODE_LOCATION_DILI, params=post_data)
        # 解析JSON响应
        data = response.json()
        return data